function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
import { createContext } from 'react';
var hasNativePerformanceNow = (typeof performance === "undefined" ? "undefined" : _typeof(performance)) === 'object' && typeof performance.now === 'function';
var now = hasNativePerformanceNow ? function () {
  return performance.now();
} : function () {
  return Date.now();
};
export function cancelTimeout(timeoutID) {
  cancelAnimationFrame(timeoutID.id);
}
export function requestTimeout(callback, delay) {
  var start = now();
  function tick() {
    if (now() - start >= delay) {
      callback.call(null);
    } else {
      timeoutID.id = requestAnimationFrame(tick);
    }
  }
  var timeoutID = {
    id: requestAnimationFrame(tick)
  };
  return timeoutID;
}
export function shallowDiffers(prev, next) {
  var exceptKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  for (var attribute in prev) {
    if (attribute !== exceptKey && !next.hasOwnProperty(attribute)) {
      return true;
    }
  }
  for (var _attribute in next) {
    if (_attribute !== exceptKey && prev[_attribute] !== next[_attribute]) {
      return true;
    }
  }
  return false;
}
export function areEqual(prevProps, nextProps) {
  return !shallowDiffers(prevProps.style || {}, nextProps.style || {}) && !shallowDiffers(prevProps, nextProps, 'style');
}
export var CellTypeEnum = /*#__PURE__*/function (CellTypeEnum) {
  CellTypeEnum[CellTypeEnum["BodyCell"] = 0] = "BodyCell";
  CellTypeEnum[CellTypeEnum["MergeCell"] = 1] = "MergeCell";
  CellTypeEnum[CellTypeEnum["AggregateCell"] = 2] = "AggregateCell";
  CellTypeEnum[CellTypeEnum["FixedBodyCell"] = 3] = "FixedBodyCell";
  CellTypeEnum[CellTypeEnum["ExpandRowCell"] = 4] = "ExpandRowCell";
  CellTypeEnum[CellTypeEnum["GroupRowCell"] = 5] = "GroupRowCell";
  CellTypeEnum[CellTypeEnum["ZwCell"] = 6] = "ZwCell";
  return CellTypeEnum;
}({});
export var UpdateFlagEnum = /*#__PURE__*/function (UpdateFlagEnum) {
  UpdateFlagEnum[UpdateFlagEnum["None"] = 0] = "None";
  UpdateFlagEnum[UpdateFlagEnum["ColumnChecked"] = 1] = "ColumnChecked";
  UpdateFlagEnum[UpdateFlagEnum["RowUpdate"] = 2] = "RowUpdate";
  UpdateFlagEnum[UpdateFlagEnum["UserUpdate"] = 3] = "UserUpdate";
  UpdateFlagEnum[UpdateFlagEnum["ForceUpdate"] = 4] = "ForceUpdate";
  return UpdateFlagEnum;
}({});

// table 数据行的选择模式
export var TableSelectionModel = /*#__PURE__*/function (TableSelectionModel) {
  TableSelectionModel[TableSelectionModel["ROW"] = 0] = "ROW";
  TableSelectionModel[TableSelectionModel["CHECKBOX"] = 1] = "CHECKBOX";
  TableSelectionModel[TableSelectionModel["MULTIPLE_INTERVAL"] = 2] = "MULTIPLE_INTERVAL";
  return TableSelectionModel;
}({});
export var AttachmentTemp = Symbol('__attachment_temp__');
export var IS_GROUP = Symbol('isGroup');
export var IS_EXPANDED = Symbol('isExpanded');
export var TableContext = /*#__PURE__*/createContext({
  table: {},
  columns: []
}); //创建context
export var DsContext = /*#__PURE__*/createContext([]); //创建context